package com.luying.controller.controller;

import com.luying.pojo.*;
import com.luying.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 */
@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @PostMapping("/intelligenceScore")
    public Result queryIntelligenceScore(@RequestBody StudentScorePageQuery pageQuery) {
        return Result.ok(studentService.queryIntelligenceScore(pageQuery));
    }
    @PostMapping("/moralScore")
    public Result queryMoralScore(@RequestBody StudentScorePageQuery pageQuery) {
        return Result.ok(studentService.queryMoralScore(pageQuery));
    }
    @GetMapping("/year")
    public Result year(){
        return Result.ok( studentService.queryYear());
    }
    @PostMapping("/totalScore")
    public Result queryTotalScore(@RequestBody StudentScorePageQuery pageQuery) {
        return Result.ok(studentService.queryTotalScore(pageQuery));
    }
}
